{% if not role|default(null) == 'teacher' %}

<div class="testpaper-question testpaper-question-fill {% if setting('magic.testpaper_watermark') %}testpaper-watermark{% endif %}" data-watermark-url="{{ path('cloud_testpaper_watermark') }}" id="question{{ item.question.id }}">
	<div class="testpaper-question-body">
	  {% include 'TopxiaWebBundle:QuizQuestionTest:testpaper-question-stem.html.twig' %}
  </div>

	{% if (paperResult.status|default(null) in ['reviewing', 'finished'] and setting('questions.testpaper_answers_show_mode','submitted') == 'submitted' ) or (setting('questions.testpaper_answers_show_mode','submitted') == 'reviewed'  and paperResult.status|default(null) == 'finished' ) %}
		<div class="testpaper-question-footer clearfix">
		  <div class="testpaper-question-result">
		    <ul>
		      {% for index, answer in item.question.answer %}
		        {% set userAnswer = item.question.testResult.answer[index]|default(null) %}
			    	<li>
			    		{{'填空(%index%)： 正确答案'|trans({'%index%': index+1})}} <strong class="text-success">{{ answer|join(' 或 '|trans) }}</strong>
			    	  {% if userAnswer == '' %}
			    	  {{'。你未回答'|trans}}
			    	  {% elseif item.question.testResult.status == "right" %}
			    	  {{'，你的答案'|trans}}　<strong class="text-success">{{ userAnswer }}</strong>。
			    	  {% elseif item.question.testResult.status == "partRight" %}
			    	  {{'，你的答案'|trans}}　<strong class="text-warning">{{ userAnswer }}</strong>。
			    	  {% else %}
			    	  {{'，你的答案'|trans}}　<strong class="text-danger">{{ userAnswer }}</strong>。
			    	  {% endif %}
			    	</li>
		    	{% endfor %}
		    </ul>

		    {% if item.question.testResult.status == "right" %}
			    <p class="text-success">{{'回答正确。'|trans}}</p>
			  {% elseif item.question.testResult.status == "partRight" %}
			    <p class="text-warning">{{'回答部分正确，本题得分：%testResult.score%分。'|trans({'%testResult.score%': item.question.testResult.score})}}</p>
			  {% else %}
			    <p class="text-danger">{{'回答错误。'|trans}}</p>
			  {% endif %}
			</div>

			<div class="testpaper-question-actions pull-right">
				{% include 'TopxiaWebBundle:QuizQuestionTest:flag.html.twig' with { flags:['favorite', 'analysis'] } %}
			</div>

		</div>
		<div class="testpaper-question-analysis well" style="display:none;">
			{{ item.question.analysis|bbCode2Html|raw|nl2br }}
			{% include 'TopxiaWebBundle:Attachment/Widget:list.html.twig' with {targetType:'question.analysis', targetId:item.question.id  } %}
		</div>
	{% else %}
	  <div class="testpaper-question-footer clearfix">
		  <div class="testpaper-question-fill-inputs">
				{% set input_index = 1 %}
				{% for answer in item.question.answer %}
					<input class="form-control " type="text" data-type="fill" name="{{ item.question.id }}" placeholder="{{'填空(%input_index%)答案，请填在这里'|trans({'%input_index%': input_index})}}" {% if item.question.testResult.answer[input_index - 1]|default(null) %}value="{{ item.question.testResult.answer[input_index - 1] }}"{% endif %} />
					{% set input_index = input_index + 1 %}
				{% endfor %}
			</div>

			<div class="testpaper-question-actions pull-right">
		  	{% include 'TopxiaWebBundle:QuizQuestionTest:flag.html.twig' with { flags:['mark', 'favorite'],resultStatus:paperResult.status|default(null) } %}
		  </div>
	  </div>

	  {% if questionPreview|default(false) %}
	  <div class="testpaper-preview-answer clearfix mtl mbl">
	  	<div class="testpaper-question-result">
		    <ul>
		      {% for index, answer in item.question.answer %}
		    	<li>
		    		{{'填空(%index%)： 正确答案'|trans({'%index%': index+1})}} <strong class="text-success">{{ answer|join(' 或 '|trans) }}</strong>
		    	</li>
		      {% endfor %}
		    </ul>
		</div>
	  </div>
	  <div class="testpaper-question-analysis well">
	  	{{ item.question.analysis|default('无解析'|trans)|bbCode2Html|raw|nl2br }}
		{% include 'TopxiaWebBundle:Attachment/Widget:list.html.twig' with {targetType:'question.analysis', targetId:item.question.id  } %}
	  </div>
	  {% endif %}

	{% endif %}
</div>

{% endif %}